package com.settlement.system.model.entity.common;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.settlement.system.converter.BigNumberFormatConvert;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * WP-唯品发货单价
 * @author Ximi
 * @since 2020-10-30
 */
@Data
@ExcelIgnoreUnannotated
@HeadStyle(fillBackgroundColor = 9,fillForegroundColor = 9)
@HeadRowHeight(value = 20)
@HeadFontStyle(fontHeightInPoints = 14)
public class TblWpDeliveryUnitPrice extends BaseModel implements Serializable {

    private String batchNumber;

    /**
     * 来自哪个表
     */
    private String fromTable;

    /**
     * 原Id
     */
    private String fromId;

    /**
     * 店铺编码
     */
    @ExcelProperty(value = "店铺编码")
    @ApiModelProperty(value = "店铺编码")
    @NotNull(message = "店铺编码不能为空")
    private String shopNo;

    /**
     * 店铺名称
     */
    @ExcelProperty(value = "店铺名称")
    @ApiModelProperty(value = "店铺名称")
    private String shopName;

    /**
     * PO单号
     */
    @ExcelProperty(value = "PO单号",converter = BigNumberFormatConvert.class)
    @ApiModelProperty(value = "PO单号")
    @NotNull(message = "PO单号不能为空")
    private String poNo;

    /**
     * SKU
     */
    @ExcelProperty(value = "SKU",converter = BigNumberFormatConvert.class)
    @ApiModelProperty(value = "SKU")
    @NotNull(message = "SKU不能为空")
    private String sku;

    public void setSku(String sku) {
        if(sku!=null){
            sku = sku.toUpperCase();
        }
        this.sku = sku;
    }

    public void setPoSku(String poSku) {
        if(poSku!=null){
            poSku = poSku.toUpperCase();
        }
        this.poSku = poSku;
    }

    /**
     * POSKU
     */
    @ExcelProperty(value = "POSKU",converter = BigNumberFormatConvert.class)
    @ApiModelProperty(value = "POSKU")
    @NotNull(message = "POSKU不能为空")
    private String poSku;

    /**
     * 发货单价
     */
    @ExcelProperty(value = "发货单价")
    @ApiModelProperty(value = "发货单价")
    @NotNull(message = "发货单价不能为空")
    private BigDecimal price;

    /**
     * 销售单价
     */
    @ExcelProperty(value = "销售单价")
    @ApiModelProperty(value = "销售单价")
    private BigDecimal salePrice;

    /**
     * 非退供差异单价
     */
    @ExcelProperty(value = "非退供差异单价")
    @ApiModelProperty(value = "非退供差异单价")
    private BigDecimal nonRefundDifPrice;

    /**
     * 退供差异单价
     */
    @ExcelProperty(value = "退供差异单价")
    @ApiModelProperty(value = "退供差异单价")
    private BigDecimal refundDifPrice;

    /**
     * 一退单价
     */
    @ExcelProperty(value = "一退单价")
    @ApiModelProperty(value = "一退单价")
    private BigDecimal firstReturnPrice;

    /**
     * 三退单价
     */
    @ExcelProperty(value = "三退单价")
    @ApiModelProperty(value = "三退单价")
    private BigDecimal thirdReturnPrice;

    /**
     * 三退单价
     */
    @ExcelProperty(value = "门店供货价")
    @ApiModelProperty(value = "门店供货价")
    private BigDecimal shopSupplyPrice;

    /**
     * 销售活动折扣
     */
    @ExcelProperty(value = "销售活动折扣")
    private BigDecimal vendorAmount;

    /**
     * 销售数量
     */
    @ExcelProperty(value = "销售数量")
    private Integer transactionQuantity;

    /**
     * 平均优惠
     */
    @ExcelProperty(value = "平均优惠")
    private BigDecimal avgDiscount;
}
